<?php

/**
 * FootballFactory, Copyright Robin Loop & Pascal Wirz, 2013
 * ---
 * [Beschreibung der Datei]
 *
 * @author Robin
 */

session_start();

// Falls nicht schon login-Seite und nicht eingelogged, dann zum login weiterleiten
if (strcmp(basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']),"admin.php") != 0) {
    if (!isset($_SESSION['username'])) {
        header('Location: admin.php');
        exit;
    }
}

require('templates/header.php');
?>
<html>
    <head>
        
        <!-- JQuery -->
        <script src="../js/jquery-1.8.3.min.js"></script>
        <script src="../js/jquery-ui-1.9.2.custom.min.js"></script>
        
        <!-- JS -->
        <script src="../js/admin_loginform.js"></script>
        
        <!-- CSS -->
        <link href="../css/admin.css" rel="stylesheet">
        <link href="../css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
        
    </head>

    <body>
        <div id="loginForm" class="ui-widget center ui-corner-all shadow">

            <form action="admin.php?action=login" method="post">

                <input type="hidden" name="login" value="true" />

                <input id="username" class="block center loginInput" type="text" name="username" placeholder="Benutzername">

                <input id="password" class="block center loginInput" type="password" name="password" placeholder="Passwort">

                <input id="loginButton" type="submit" value="Login">

            </form>
            
            <?php if ($wrongPW == true) { ?>
            <div id="wrongPWMessage" class="ui-widget ui-state-error ui-corner-all" style="padding: 0 .7em;width:260px;position:fixed;left: 50%; bottom: 10px;margin-left:-130px;">
		<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
		Falsches Passwort und/oder Benutzername</p>
            </div>
            <?php } ?>
        </div>
    
    </body>
</html>
